﻿using Ledict.ConditionExtract.Common;
using Ledict.Core.Data;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ledict.ConditionExtract.DAL
{
    public class CaseLogicPartInfoesDAL
    {
        /// <summary>
        /// 获取存储争议焦点内容
        /// </summary>
        /// <returns></returns>
        public string GetCaseLogicPartInfoes(string caseId)
        {
            string strSql = string.Format(@"   select CourtAffirm FROM [CaseWorking_all].[dbo].[CaseLogicPartInfoes] where ID='{0}' ", caseId);
            Database oBase = DatabaseFactory.CreateDatabase("CaseWorkingall");
            DbCommand oCmd = oBase.GetSqlStringCommand(strSql.ToString());
            return LdFormat.ObjectToString(oBase.ExecuteScalar(oCmd));
        }

        /// <summary>
        /// 获取存储争议焦点内容
        /// </summary>
        /// <returns></returns>
        public string GetCaseLogicPartInfoesNew(string caseId)
        {
            string strSql = string.Format(@"   select C_Text from CaseLogicPartInfoSon where C_Type='Dispute' and CaseID='{0}' ", caseId);
            Database oBase = DatabaseFactory.CreateDatabase("CaseWorkingall");
            DbCommand oCmd = oBase.GetSqlStringCommand(strSql.ToString());
            return LdFormat.ObjectToString(oBase.ExecuteScalar(oCmd));
        }
    }
}
